<template>
  <div class="my">
    <div class="head_img">
      <img src="../../../static/icon/touxiang.jpg" alt="">
    </div>
    <p class="custom_name">如你客户1</p>
    <cell title="我的订单" value="全部订单" is-link @click.native="all_order()"></cell>
    <div class="order border-1px">
      <div class="order_item" v-for="item in tab" @click="link_func(item)">
        <p>
          <img :src="item.icon" alt="" class="icon">
        </p>
        <p> {{ item.name }} </p>
      </div>
    </div>
  <menu-list/>
  </div>
</template>
<script>
import menuList from './menu'
import { Cell } from 'vux'
export default {
  components: {
    menuList,
    Cell
  },
  created() {
    this.$store.state.main_tle_show = false
  },
  data() {
    return {
      tab: [
        {
          name: "待支付",
          state: 0,
          icon: "../../../static/icon/4.png"
        },
        {
          name: "待发货",
          state: 1,
          icon: "../../../static/icon/1.png"
        },
        {
          name: "待收货",
          state: 2,
          icon: "../../../static/icon/3.png"
        },
        {
          name: "已完成",
          state: 3,
          icon: "../../../static/icon/2.png"
        },
        {
          name: "退款售后",
          state: 4,
          icon: "../../../static/icon/5.png"
        }
      ]
    }
  },
  methods: {
    link_func(item){
      this.$store.state.order_state = item.state
      this.$router.push('/order_list')
    },
    all_order(){
      this.$store.state.order_state = 5
      this.$router.push('/order_list')
    }
  }
}
</script>
<style scoped>
.border-1px {
  margin-bottom: 10px;
  box-shadow: 3px 5px 3px #eee;
}



.tle {
  padding-left: 10px;
}
.head_img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #eee;
  overflow: hidden;
  margin: 15px auto;
}
.custom_name {
  text-align: center;
  font-size: 96%;
  margin: 15px 0;
}
.head_img img {
  width: 100%;
}
.order {
  display: flex;
  /* flex-direction: row;
  flex-wrap: nowrap;
  justify-content: space-around; */
  font-size: 14px;
  padding: 20px 0;
}
.order .order_item {
  text-align: center;
  flex: 1;
}

.order_item .icon {
  width: 32px;
  margin-bottom: 10px;
}
</style>

